package com.example.common.msg.service.impl;

import com.example.common.base.constant.MqQueueConstant;
import com.example.common.msg.service.SendMsgService;
import com.example.common.msg.template.MsgTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class SendMsgServiceImpl implements SendMsgService {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    /**
     * 发送用户操作日志消息
     * @param msgTemplate
     */
    @Override
    public void sendMemberLog(MsgTemplate msgTemplate) {
        rabbitTemplate.convertAndSend(MqQueueConstant.MEMBER_LOG, msgTemplate);
    }
}
